package com.design.mode.observer;

/**
 * 描述:
 * 观察者实现
 *
 * @author luzhongfu
 * @create 2018-12-23 3:13 PM
 */
public class User implements Observer {

    private String name;

    private String message;

    public User(String name) {
        this.name = name;
    }

    @Override
    public void update(String message) {
        this.message = message;
        read();
    }

    private void read(){
        System.out.println("从微信推送了消息：" + message);
    }
}
